<?php

	session_start();

	require_once("appconf.php");
	require_once("lib/utility.php");
	require_once("lib/class.Template.php");

	if(!isset($_SESSION['username'])) {
		header("HTTP/1.1 401 Unauthorized");
		die();
	}


	header("Content-Type: text/xml");


	$dirName  = $appRoot."data/".filenameSafe($_SESSION['username'])."/templates";
	$filename = $_REQUEST["file"];

	if ($filename) {
		$filepath = $dirName . "/" . $filename;

		if (is_file($filepath)) {
			echo file_get_contents($filepath);
		}
	}

?>